

/*
macro_rules! call_1_or_2_args { 
    ($args1:ident) => {
        call_1_or_2_args!($args1,  func)
    }

    ($args1:ident, $args2: ident) => {
        fn $arg1<V>(self, visitor: V) -> Result<V::Value> 
        where 
            V: de:Visitor<'de> , 
        {
            self.$args2(visitor)
        }
    }
}
*/


macro_rules! macro_first {
    ($arg1: ident) => {
        println!("{}", $arg1);
    };
}

const HELLO:u32 = 56;

macro_rules! macro_two {
    ($arg1:ident) => {
        macro_two!($arg1, HELLO); //NOTE
    };

    ($arg1:ident, $arg2:ident) => {
        println!("{}:{}", $arg1, $arg2);
    };
}

macro_rules! macro_expr {
    ($this: ident  $($body: tt)* ) => {
        $this.push('w');
        $this.push('o');

        $this $($body)*
    };
}



#[cfg(test)]
mod test {
    use super::*;
    #[test]
    fn call_macro() {

        let hello = 12_i32;
        macro_first!(hello);
        
        let world = 34_i32;
        macro_two!(world, hello);
        macro_two!(world);


        let mut m_hello = "hello".to_string();
        macro_expr! {
            m_hello.push('r');
            m_hello.push('l');
            m_hello.push('d');
            println!("output-macro_expr! :{}", m_hello);
        }

    }
}
